import service from '../../utils/request'
export function adminLogin(payload = {}) {
    return service({
        url: '/admin/login',
        method: 'post',
        data: payload
    })
}
// 用户
// 新增
export function user_add(payload = {}) {
    return service({
        url: '/user/add',
        method: 'post',
        data: payload
    })
}
// 请求所有用户数据  分页
export function user_queryAll(payload = {}) {
    return service({
        url: '/user/queryAll',
        method: 'get',
        params: payload
    })
}
// 更新状态
export function user_updateStatus(userId: any, status: any) {
    return service({
        url: `/user/updateStatus/${userId}/${status}`,
        method: 'put',
    })
}
// 更新状态
export function user_querySingle(payload = {}) {
    return service({
        url: '/user/querySingle',
        method: 'get',
        params: payload
    })
}
// 上传图片接口
export function user_uploade(payload = {}) {
    return service({
        url: '/user/upload',
        method: 'post',
        data: payload,
    })
}
// 状态条件查询
export function user_queryStatus(payload = {}) {
    return service({
        url: '/user/queryStatus',
        method: 'get',
        params: payload
    })
}
// 修改用户
export function user_update(payload = {}) {
    return service({
        url: '/user/update',
        method: 'put',
        data: payload
    })
}
// 删除用户
export function user_delete(payload: any) {
    return service({
        url: `/user/delete/${payload}`,
        method: 'delete'
    })
}
// 关键字查询
export function user_queryKey(payload = {}) {
    return service({
        url: "/user/queryKey",
        method: 'get',
        params: payload
    })
}

// 角色
// 获取分页数据
export function role_queryAll(payload = {}) {
    return service({
        url: "/role/queryAll",
        method: 'get',
        params: payload
    })
}
// 新增角色
export function role_add(payload = {}) {
    return service({
        url: "/role/add",
        method: 'post',
        data: payload
    })
}
// 更改角色状态
export function role_updateStatus(roleId: any, roleStatus: any) {
    return service({
        url: `/role/updateStatus/${roleId}/${roleStatus}`,
        method: 'put'
    })
}
// 按状态查询
export function role_queryStatus(payload = {}) {
    return service({
        url: "/role/queryStatus",
        method: 'get',
        params: payload
    })
}
// 查询单个数据
export function role_querySingle(payload = {}) {
    return service({
        url: "/role/querySingle",
        method: 'get',
        params: payload
    })
}
// 修改角色
export function role_update(payload = {}) {
    return service({
        url: "/role/update",
        method: 'put',
        data: payload
    })
}
// 关键字查询
export function role_queryKey(payload = {}) {
    return service({
        url: "/role/queryKey",
        method: 'get',
        params: payload
    })
}
// 删除角色
export function role_delete(roleId: any) {
    return service({
        url: `/role/delete/${roleId}`,
        method: 'delete'
    })
}




// 仓库
// 获取分页数据
export function stash_queryAll(payload = {}) {
    return service({
        url: "/stash/queryAll",
        method: 'get',
        params: payload
    })
}
// 新增仓库
export function stash_add(payload = {}) {
    return service({
        url: "/stash/add",
        method: 'post',
        data: payload
    })
}
// 更改仓库状态
export function stash_updateStatus(stashId: any, stashStatus: any) {
    return service({
        url: `/stash/updateStatus/${stashId}/${stashStatus}`,
        method: 'put'
    })
}
// 按状态查询
export function stash_queryStatus(payload = {}) {
    return service({
        url: "/stash/queryStatus",
        method: 'get',
        params: payload
    })
}
// 查询单个数据
export function stash_querySingle(payload = {}) {
    return service({
        url: "/stash/querySingle",
        method: 'get',
        params: payload
    })
}
// 修改仓库
export function stash_update(payload = {}) {
    return service({
        url: "/stash/update",
        method: 'put',
        data: payload
    })
}
// 关键字查询
export function stash_queryKey(payload = {}) {
    return service({
        url: "/stash/queryKey",
        method: 'get',
        params: payload
    })
}
// 删除仓库
export function stash_delete(roleId: any) {
    return service({
        url: `/stash/delete/${roleId}`,
        method: 'delete'
    })
}